import random

from langchain.agents import tool


class SillyWeatherMan:
    @staticmethod
    def get_tools():
        return [SillyWeatherMan.query_temperature]

    @staticmethod
    @tool
    def query_temperature(location: str):
        """Query the current temperature in centigrade of the location. """
        return str(random.randint(100, 300))


if __name__ == "__main__":
    resp = SillyWeatherMan.get_tools()[0].run("ChengDu")
    print(resp)
